import { Button as AntdButton } from 'antd';
import type { CommonComponentProps } from '../../editor/interface';
import { useDrag } from 'react-dnd';
import { use } from 'react';

const Button = ({ id, type, text, styles }: CommonComponentProps) => {
  const [_, dragRef] = useDrag({
    type: 'Button',
      item: {
        type: 'Button',
        dragType: 'move',
        id: id
    }
  });
  return (
    <AntdButton ref={dragRef} data-component-id={id} type={type} style={styles}>{text}</AntdButton>
  )
}
export default Button;
